import React, {useState} from 'react';
import { Modal, Button } from 'antd';
import CRegisterForm from '../registerForm';

const CRegisterModal = () => {

  const [register_seen, setRegisterSeen] = useState(false);

  const registerClick = (e) => {
    setRegisterSeen(true);
    e.preventDefault();
  }
  const registerCancel = () => {
    setRegisterSeen(false);
  }

  return (
    <div>
      <Button 
        type="text" 
        style={{color: '#fff'}}
        onClick={registerClick}
        >
        register
      </Button>
      <Modal className="register_modal"
        title="Register Form"
        visible={register_seen}
        onCancel={registerCancel}
        footer={null}
      >
        <CRegisterForm registerCancel={registerCancel} />
      </Modal>
    </div>
  )
}

export default CRegisterModal;